import http from "@/http";
import { GoodsCategory, CategoryListParams } from "./CategoryModel";

// 新增分类接口
// 对应后端 @RequestMapping("/api/goodsCategory")
export const addGoodsCategoryApi = (param: GoodsCategory) => {
  return http.post("/api/goodsCategory", param);
};

// 查询分类列表接口
export const queryGoodsCategoryListApi = (param: CategoryListParams) => {
  return http.get("/api/goodsCategory/getList", param);
};

// 编辑分类接口
export const editGoodsCategoryApi = (param: GoodsCategory) => {
  return http.put("/api/goodsCategory", param);
};

// 删除分类接口
export const deleteGoodsCategoryApi = (CategoryId: number) => {
  return http.delete(`/api/goodsCategory/${CategoryId}`);

};
